package com.redis;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.util.Properties;

/**
 * 
 * @author wy
 */
public class ConfigUtil {
	private static Resource resource = new ClassPathResource(
			"/local/redis.properties");

	private static Properties props = null;
	
	private static Properties msgProps = null;

	public static String getProperties(String key) {
		if (null == props) {
			try {

				props = PropertiesLoaderUtils.loadProperties(resource);

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return props.getProperty(key);

	}



}
